home *** CD-ROM | disk | FTP | other *** search
/ Family Forum 259 / SOMC Family Forum 259 - Disc 1.iso / INSTALL.RUL < prev    next >
Text File  |  1991-11-22  |  22KB  |  646 lines

  1. //
  2. //      Children's Dictionary Installation Script
  3. //
  4. //      Descrip :  This program moves system files to the user's
  5. //                 hard disk and updates the win.ini and system.ini
  6. //                 (if necessary), and the macmmd.ini.  If requested,
  7. //                 the program also copies the movies and database
  8. //                 to the hard disk.
  9.  
  10.     /*--------------------------------------------------------*/
  11.     /*                  Constant Declarations                 */
  12.     /*--------------------------------------------------------*/
  13. #define STD_MAX_SIZE         100
  14. #define ALT_MAX_SIZE         200
  15.  
  16. // These numbers should include a buffer of about 1/2 of the required space?
  17. #define ALT_FILE_SIZE     4000000 // required for user files
  18. #define BASE_FILE_SIZE    200000 // when this changes, line in CopySystemFiles 
  19.                   // must be changed.
  20. #define RUNTIME_SIZE      1500000
  21.  
  22.     /*--------------------------------------------------------*/
  23.     /*                  Variable Declarations                 */
  24.     /*--------------------------------------------------------*/
  25. declare
  26.     string  szText[ ALT_MAX_SIZE ];
  27.     string  szDefPath[ STD_MAX_SIZE ];
  28.     string  szRunPath[ STD_MAX_SIZE ];
  29.     string  szRunName[ STD_MAX_SIZE ];
  30.     string  szTbkPath[ STD_MAX_SIZE ];
  31.     string  szSbkName[ STD_MAX_SIZE ];
  32.     string  szAppPath[ STD_MAX_SIZE ];  //directory user want files
  33.     string  szResultPath[ STD_MAX_SIZE ];
  34.     string  szCommand[ STD_MAX_SIZE ];
  35.     string  szDisk[ 50 ];
  36.     string  szBitmapPath[ STD_MAX_SIZE ];
  37.     string  szErrMsg [ ALT_MAX_SIZE ];
  38.     string  szErrFile [ STD_MAX_SIZE ];
  39.     string  szREADME [ ALT_MAX_SIZE ];
  40.     string  szUserDir [STD_MAX_SIZE];
  41.     string  szSrcDir [STD_MAX_SIZE];  // This is used until install 
  42.                       // on same disk as product files
  43.  
  44.     number  nSpaceRequired;
  45.     number  nUseHardDisk;
  46.     number  nNeedRuntime;
  47.     number  nLen;
  48. program /* Must use program keyword to start the statements */
  49.  
  50.  
  51. Start:
  52. //       Enable( DEFWINDOWMODE );
  53.        Handler( EXIT, HandleExit );
  54.  
  55.        // Set the color of the back to be WHITE
  56.        SetColor( BACKGROUND, RGB(255,255,255) );
  57.  
  58.        SetColor( STATUSBAR, RGB( 255,0,0) );
  59. //       SetFont( FONT_TITLE, STYLE_BOLD, "Helv" );
  60.  
  61. //       SetTitle( "Macmillan Children's Dictionary", 24, BLUE );
  62.        SetStatusWindow( 1, "  Begin installation process." );
  63. //       SizeWindow(INFO,320,250);
  64.        SizeWindow( INFO, 320,75);
  65.        PlaceWindow(INFO,40,40,UPPER_LEFT);
  66.        PlaceWindow(STATUS,40,40,LOWER_LEFT);
  67.        PlaceWindow(PAUSE,420,40,LOWER_LEFT);
  68.        PlaceWindow(EXIT,520,40,LOWER_LEFT);
  69.        // Enable various objects.
  70.        Enable( BITMAPFADE );    // All bitmaps will fade into the screen.
  71. //       Enable( HELP );          // Help Button
  72.        Enable( EXIT );          // Exit Button
  73.        Enable( PAUSE );         // Pause Button
  74.        Enable( STATUS );        // Status , % Complete Bar Window
  75.        Enable( TEXT );          // Info Windows
  76. //       Enable( FEEDBACK_SPACE);  // Feedback window enabled
  77.        Enable( BACKGROUND );    // Display background and all windows
  78.  
  79.        
  80.        // In Info Window to display the 1.txt
  81.        SetInfoWindow( "Welcome", "install1.txt" );      
  82. DrawBitmap:
  83.     // Determine the source path of the bitmap file
  84.     StrCopy( szResultPath, SRCDIR );
  85.     AppendToPath( szResultPath, "dixinst.bmp" );
  86.  
  87.     // Place product logo in the top right corner
  88.     PlaceBitmap( szResultPath, 101, 40, 40, UPPER_RIGHT );
  89.     Disable( BITMAPFADE );  // Bitmaps will now be drawn and not faded in
  90.     Delay(1);
  91.  
  92. GetSourceDir:
  93. //     SetDialogTitle(DLG_ASK_PATH,"SOURCE DIRECTORY");
  94. //     AskPath("What is source directory?","D:\\",szSrcDir);
  95. //     if LAST_RESULT = FALSE then 
  96. //       call ConfirmCancel;
  97. //       goto GetSourceDir;
  98. //     endif; 
  99. //     // If correct disk entered, then BeginInstall;
  100. //     ExistsDisk( "D:" );
  101. //     if LAST_RESULT != EXISTS then
  102. //          MessageBox("No such Disk, D", WARNING);
  103. //          exit;
  104. //      endif;  
  105. //       ExistsDir( szSrcDir );
  106. //       if LAST_RESULT != EXISTS then
  107. //          // Invalid disk entered, reprompt
  108. //          StrCopy( szText, szSrcDir );
  109. //          StrConcat( szText, " - is an invalid disk, press Ok to return to the path selection");
  110. //          MessageBox( szText, WARNING );
  111. //          goto GetSourceDir;
  112. //       endif;
  113.  
  114. //       StrCopy(SRCDIR,szSrcDir);
  115.  
  116.        // In Info Window to display the 2.txt
  117. //       SetInfoWindow( "Hard Disk Usage ", "install2.txt" );
  118. //       Delay(3);
  119.  
  120. // DPK - 
  121. //       StrCopy(SRCDIR, "D:\\");
  122.  
  123.        // Increment % Complete Bar to 4 %, & display message
  124.        SetStatusWindow( 4, "Begin installation process" );
  125.  
  126. //       SetDialogTitle(DLG_ASK_YESNO,"USE HARD DISK");
  127.        // Ask user if okay to use hard disk space
  128. //       AskYesNo("Is it okay to use hard disk space for some of the product? (Approximately 3.5 megabytes will be used)",TRUE);
  129. // dpk1
  130. //       AskYesNo("May we use some of your hard disk? It will speed up the dictionary and let you store your own list of words. (Approximately 2 megabytes will be used)",
  131. //     TRUE);
  132. //       if LAST_RESULT = TRUE then 
  133. //     nUseHardDisk = 1;
  134. //     call AppTargetLoc;
  135. //       else
  136. //     nUseHardDisk = 0;
  137. //       endif;
  138. // dpk - don't disable the info window for now  
  139. //       Disable(INFO);        
  140.  
  141.    // Get the subdirectory to install to...
  142.       call AppTargetLoc;
  143.  
  144.       // copy system type of files and update win.ini
  145.       call CopySysFiles;
  146.  
  147.       // copy files to hard disk
  148. //      if nUseHardDisk = 1 then
  149. //     call CopyAppFiles;
  150. //      endif;
  151.  
  152.       call CopyAppFiles;
  153.       call IniUpdate;
  154.  
  155. Complete:
  156.        // Now create a program group & icons
  157.        SetStatusWindow( 95, "Creating Program Group & Icons");
  158.        Delay( 1 );
  159.        AppCommand( PROGMAN, CMD_RESTORE );
  160. //       DeleteGroup( "Macmillan");
  161.   
  162.        StrCopy( szDefPath, SRCDIR );
  163.        AppendToPath( szDefPath, "MACMMD.TBK" );
  164.        StrCopy( szCommand, szRunName);
  165. //       if nNeedRuntime = 1 then
  166. //                      StrConcat( szCommand, "\\TBOOK.EXE ");
  167. //       endif;
  168.        StrConcat( szCommand, " ");
  169.        StrConcat( szCommand, szDefPath );
  170.        StrCopy(szResultPath,WINDIR);
  171.        AppendToPath(szResultPath,"MACMMD.ICO");
  172.  
  173.        AddProgItem( "Macmillan", "Dictionary for Children", szCommand,
  174.       szResultPath);
  175.        Delay ( 2 );
  176.  
  177.        AppCommand( PROGMAN, CMD_PUSHDOWN );
  178.  
  179.        SetStatusWindow( 100, "Installation complete..." );
  180.        Delay( 1 ); //Artificial Delay
  181.        
  182.        Disable(INFO);        // get rid of that thing now
  183.        MessageBox("Installation Complete!", INFORMATION);
  184.        exit;
  185.  
  186. // Ask if they want to restart windows or exit to windows
  187. //       SetDialogTitle(DLG_ASK_YESNO,"RESTART WINDOWS");
  188. //       AskYesNo("You must restart Windows to run the Dictionary for Children. Restart Windows now?", TRUE);
  189. //       if LAST_RESULT = TRUE  then
  190. //        System( SYS_BOOTWIN );
  191. //       else
  192. //        exit;  // Exit installation program.
  193. //       endif;
  194.  
  195. //-----------------------------------------------------------------------------
  196. //
  197. //      Name:       AppTargetLoc
  198. //
  199. //      Descrip:    This procedure will get the directory name to copy 
  200. //                  application files into, and check disk space for those
  201. //                  files.
  202. //                  It also asks if the user wants to install the movies onto 
  203. //                  the hard disk or not.
  204. //-----------------------------------------------------------------------------
  205. AppTargetLoc:
  206. TargetLoc:
  207.        // Determine target location for files
  208.        GetDisk( TARGETDIR, szDisk );
  209.        StrCopy( szDefPath, szDisk );
  210.        StrConcat( szDefPath, "\\MACMMD" );
  211.  
  212.        SetDialogTitle(DLG_ASK_PATH,"DESTINATION DIRECTORY");
  213.       // Want to ask user for a path to install InstallSHIELD
  214.        StrCopy( szText, "We must use some disk space for Dictionary files.\n Please enter the desired location." );
  215.        AskPath( szText, szDefPath, szAppPath );
  216.     if LAST_RESULT = FALSE then call ConfirmCancel; endif;
  217.        GetDisk( szAppPath, szDisk );
  218.        // If correct disk entered, then BeginInstall;
  219.        ExistsDisk( szDisk );
  220.        if LAST_RESULT != 0 then
  221.       // Invalid disk entered, reprompt
  222.       StrCopy( szText, szAppPath );
  223.       StrConcat( szText, " - is an invalid disk, press Ok to return to the path selection");
  224.       MessageBox( szText, WARNING );
  225.       goto TargetLoc;
  226.        endif;
  227.  
  228.     // Ask user if okay to use hard disk space for the movies.
  229.        SetDialogTitle(DLG_ASK_YESNO,"USE HARD DISK");
  230.        AskYesNo("May we use additional disk space to store movies? It will speed up the dictionary considerably. (Approximately 2 megabytes will be used)",
  231.      TRUE);
  232.        if LAST_RESULT = TRUE then 
  233.      nUseHardDisk = 1;
  234.        else
  235.      nUseHardDisk = 0;
  236.        endif;
  237.  
  238. CheckDiskSpace:
  239.  
  240. // dpk - this should be set to std_file size if not copying movies....
  241.        if nUseHardDisk = 1 then
  242.      nSpaceRequired = ALT_FILE_SIZE + BASE_FILE_SIZE;
  243.        else
  244.          nSpaceRequired = BASE_FILE_SIZE;
  245.        endif;
  246.        SetStatusWindow( 16, "Continuing installation" );
  247.  
  248.        // Check to see if enough space is free on the destination.
  249.        // GetDiskSpace returns free space in LAST_RESULT.
  250.        GetDiskSpace( szDisk );
  251.        if LAST_RESULT > nSpaceRequired goto MakeDir;
  252.  
  253.        StrCopy( szText, "Not enough space on ");
  254.        StrConcat( szText, szDisk );
  255.        StrConcat( szText, " - Please press OK to try another target disk");
  256.        MessageBox( szText, WARNING );
  257.        goto TargetLoc;
  258.  
  259. MakeDir:
  260.        // Check to see if Directory Exists
  261.        // ExistsDir returns value in LAST_RESULT
  262.        ExistsDir( szAppPath );
  263.        if LAST_RESULT = 0 goto DirExists;
  264.        CreateDir( szAppPath );
  265.        if LAST_RESULT = 0 goto DirExists;
  266.        StrCopy( szText, "Unable to create specified path -");
  267.        StrConcat( szText, szAppPath );
  268.        StrConcat( szText, "Please enter a correct path like C:\\MACMMD");
  269.        MessageBox( szText, WARNING );
  270.        goto TargetLoc;
  271.  
  272. DirExists:
  273.     // include movies directory and see if IT exists...
  274.        StrCopy(szText,szAppPath);
  275.        AppendToPath( szText, "movies" ); //copy from movies directory
  276.        
  277.        ExistsDir( szText );
  278.        if LAST_RESULT = 0 goto DirExist2;
  279.        CreateDir( szText );
  280.        if LAST_RESULT = 0 goto DirExist2;
  281.        StrCopy( szText, "Unable to create specified path -");
  282.        StrConcat( szText, szAppPath );
  283.        StrConcat( szText, "Please enter a correct path like C:\\MACMMD");
  284.        MessageBox( szText, WARNING );
  285.        goto TargetLoc;
  286. DirExist2:
  287.    return;
  288.  
  289. //-----------------------------------------------------------------------------
  290. //
  291. //      Name:       CopyAppFiles
  292. //
  293. //      Descrip:    This procedure will handle the file transfer for user
  294. //                  files, if they want them moved to their harddisk
  295. //
  296. //                  dpk - Procedure is no longer voluntary. Files are copied 
  297. //                  whether or not they want them to be.
  298. //                  
  299. //
  300. //-----------------------------------------------------------------------------
  301. CopyAppFiles:
  302.  
  303.       SetStatusWindow( 55, "Copying files ..." );
  304.  
  305.       StrCopy(TARGETDIR,szAppPath);
  306.       StatusUpdate( ON, 64);
  307.       SetStatusWindow( 64, "Copying file ... allwords.*" );
  308.       CopyFile( "allwords.*", "allwords.*" );
  309.       if LAST_RESULT < 0 then
  310.       StrCopy( szErrFile, "allwords.*" );
  311.       call CopyError;
  312.       endif;
  313.  
  314.       StatusUpdate( ON, 84);
  315.       SetStatusWindow( 84, "Copying files ...pxengwin.dll " );
  316.       CopyFile( "pxengwin.dll", "pxengwin.dll");
  317.       if LAST_RESULT < 0 then
  318.       StrCopy( szErrFile, "pxengwin.dll" );
  319.       call CopyError;
  320.       endif;
  321.  
  322.    // copy ZAK movies and sound
  323.    // This is now the only voluntary stuff. The rest is all copied anyway.
  324.       if nUseHardDisk = 1 then
  325.           StrCopy(szText,SRCDIR);  //Save original SRCDIR
  326.           AppendToPath( SRCDIR, "movies" ); //copy from movies directory
  327.           AppendToPath( TARGETDIR, "movies" ); //copy from movies directory
  328.           StatusUpdate( ON, 75);
  329.           SetStatusWindow( 75, "Copying file ... movies.*" );
  330.           CopyFile( "*.*", "*.*" );
  331.                StrCopy(SRCDIR,szText);          // Restore SRCDIR
  332.           if LAST_RESULT < 0 then
  333.           StrCopy( szErrFile, "*.*" );
  334.           call CopyError;
  335.           endif;
  336.       endif;
  337.  
  338.       StatusUpdate( OFF, 0);
  339.  
  340. return;
  341. //-----------------------------------------------------------------------------
  342. //
  343. //      Name:       CopySysFiles
  344. //
  345. //      Descrip:    This procedure will handle the file transfer for user
  346. //                  files, if they want them moved to their harddisk
  347. //
  348. //      Params:
  349. //
  350. //-----------------------------------------------------------------------------
  351. CopySysFiles:
  352.  
  353.  
  354. //       GetDisk( TARGETDIR, szDisk );
  355.  
  356. // dpk - don't look for toolbook for now. Just make a directory.
  357.       //Find out if TBOOK is on disk
  358. //      StrCopy(szDefPath,szDisk);
  359.  
  360.       //Check for both TBOOK and TBKMM, since TBKMM might be new
  361. //      FindAllFiles(szDefPath,"TBOOK.EXE",szRunPath,RESET);
  362. //      if LAST_RESULT < 0  then
  363. //     nNeedRuntime = 1;
  364. //     StrCopy(szRunPath,szDisk);
  365. //     StrConcat(szRunPath,"\\TOOLBOOK");
  366. //     nSpaceRequired = nSpaceRequired + RUNTIME_SIZE;
  367. //     StrCopy(szRunName, szRunPath);
  368. //     StrConcat(szRunName, "\\tbook.exe");
  369. ////         goto CopyContinue;
  370. //      else
  371. //     StrCopy(szRunName, szRunPath);
  372. //     StrFind(szRunPath, "tbook.exe");
  373. //     Assign(nLen, LAST_RESULT);
  374. //     nLen = nLen - 1;
  375. //     StrSub(szRunPath, szRunPath, 0, nLen);
  376. //     nNeedRuntime = 0;
  377. //      endif;
  378. //
  379. //      FindAllFiles(szDefPath,"TBKMM.SBK",szTbkPath,RESET);
  380. //      if LAST_RESULT < 0  then
  381. //     nNeedRuntime = 1;
  382. //     StrCopy(szTbkPath,szDisk);
  383. //     StrConcat(szTbkPath,"\\TOOLBOOK");
  384. //     nSpaceRequired = nSpaceRequired + RUNTIME_SIZE;      
  385. //     StrCopy(szSbkName, szTbkPath);
  386. //     StrConcat(szSbkName, "\\tbkmm.sbk");
  387. //      else
  388. //     StrCopy(szSbkName, szTbkPath);
  389. //               nNeedRuntime = 0;
  390. //      endif;
  391.  
  392. // dpk - just make szRunPath the same as szAppPath for now...
  393.        StrCopy(szRunPath, szAppPath);
  394.  
  395. CopyContinue:
  396.        SetStatusWindow( 20, "Continuing installation" );
  397.        GetDisk( szResultPath, szDisk );
  398.        Delay(2);
  399.  
  400.        // Check to see if enough space is free on the destination.
  401.        // GetDiskSpace returns free space in LAST_RESULT.
  402.        nSpaceRequired = BASE_FILE_SIZE;
  403.        GetDisk(WINDIR, szDisk );
  404.        GetDiskSpace(szDisk);
  405.        if LAST_RESULT < nSpaceRequired then
  406.       StrCopy( szText, "Not enough space on ");
  407.       StrConcat( szText, szDisk );
  408.       StrConcat( szText, " to install required system files.  ");
  409.       NumToStr(szDisk,nSpaceRequired);
  410.       StrConcat( szText, szDisk);
  411.       StrConcat( szText,
  412.      " bytes are required. Please free up space and run setup again.");
  413.       MessageBox( szText, SEVERE );
  414.       exit;
  415.       endif;
  416.  
  417.       call SystemFileTransfer;
  418. return;
  419. //-----------------------------------------------------------------------------
  420. //
  421. //      Name:       SystemFileTransfer
  422. //
  423. //      Descrip:    This procedure will handle the file transfer for system
  424. //                  files.
  425. //
  426. //-----------------------------------------------------------------------------
  427. SystemFileTransfer:
  428.  
  429. //      MessageBox( SRCDIR, WARNING);
  430.  
  431.        SetStatusWindow( 21, "Copying files ..." );
  432.  
  433.        StrCopy(TARGETDIR,WINDIR);
  434.        StatusUpdate( ON, 25);
  435.        SetStatusWindow( 25, "Copying files ...macmmd.ini " );
  436. // DPK - fix this...
  437. //       CopyFile( "max.ini", "max.ini");
  438.        CopyFile( "macmmd.ini", "macmmd.ini");
  439.        if LAST_RESULT < 0 then
  440.       StrCopy( szErrFile, "macmmd.ini" );
  441.       call CopyError;
  442.        endif;
  443.  
  444.        StatusUpdate( ON, 27);
  445.        SetStatusWindow( 27, "Copying files ...macmmd.ico " );
  446.        CopyFile( "macmmd.ico", "macmmd.ico");
  447.        if LAST_RESULT < 0 then
  448.       StrCopy( szErrFile, "macmmd.ico" );
  449.       call CopyError;
  450.        endif;
  451.  
  452.       StrCopy(TARGETDIR,WINSYSDIR);
  453.        StatusUpdate( ON, 30);
  454.        SetStatusWindow( 30, "Copying file ... mmp.dll" );
  455.        CopyFile( "mmp.dll", "mmp.dll" );
  456.        if LAST_RESULT < 0 then
  457.       StrCopy( szErrFile, "mmp.dll" );
  458.       call CopyError;
  459.        endif;
  460.  
  461.        StatusUpdate( ON, 34);
  462.        SetStatusWindow( 34, "Copying file ... mcimmp.drv" );
  463.        CopyFile( "mcimmp.drv", "mcimmp.drv" );
  464.        if LAST_RESULT < 0 then
  465.       StrCopy( szErrFile, "mcimmp.drv" );
  466.       call CopyError;
  467.        endif;
  468.  
  469.     // if need to copy TBOOK and TBKMM.tbk 
  470. //       if nNeedRuntime = 1 then
  471.        ExistsDir( szRunPath );
  472.        if LAST_RESULT = 0 goto CpRunTime;
  473.        CreateDir( szRunPath );
  474.        if LAST_RESULT = 0 goto CpRunTime;
  475.        StrCopy( szText, "Unable to create specified path -");
  476.        StrConcat( szText, szRunPath );
  477.        MessageBox( szText, SEVERE );
  478.        exit;
  479. //       endif;
  480. CpRunTime:
  481. //       if nNeedRuntime = 1 then
  482.       StrCopy(TARGETDIR,szRunPath);
  483.       StatusUpdate( ON, 41);
  484.       SetStatusWindow( 41, "Copying Toolbook files ... tbook.exe" );
  485.       CopyFile( "tbook.exe", "tbook.exe" );
  486.       if LAST_RESULT < 0 then
  487.          StrCopy( szErrFile, "tbook.exe" );
  488.          call CopyError;
  489.       endif;
  490.  
  491.       StatusUpdate( ON, 44);
  492.       SetStatusWindow( 44, "Copying Toolbook files ... tbk*.dll" );
  493.       CopyFile( "tbk*.dll", "tbk*.dll" );
  494.       if LAST_RESULT < 0 then
  495.          StrCopy( szErrFile, "tbk*.dll" );
  496.          call CopyError;
  497.       endif;
  498.  
  499.       StatusUpdate( ON, 47);
  500.       SetStatusWindow( 47, "Copying Toolbook files ... tbknet.exe" );
  501.       CopyFile( "tbknet.exe", "tbknet.exe" );
  502.       if LAST_RESULT < 0 then
  503.          StrCopy( szErrFile, "tbknet.exe" );
  504.          call CopyError;
  505.       endif;
  506.  
  507. //      StatusUpdate( ON, 47);
  508. //      SetStatusWindow( 47, "Copying Toolbook files ... tbkmm.sbk" );
  509. //      CopyFile( "tbkmm.sbk", "tbkmm.sbk" );
  510. //      if LAST_RESULT < 0 then
  511. //         StrCopy( szErrFile, "tbkmm.sbk" );
  512. //         call CopyError;
  513. //      endif;
  514.  
  515. //       endif; //end of need runtime copied
  516.  
  517.        StatusUpdate( OFF, 0);
  518.  
  519. return;
  520.  
  521. //-----------------------------------------------------------------------------
  522. //
  523. //      Name:       IniUpdate
  524. //
  525. //      Descrip:    This procedure will handle the updating of both the
  526. //                  win.ini and macmmd.ini files.
  527. //
  528. //-----------------------------------------------------------------------------
  529. IniUpdate:
  530.  
  531. //      SetStatusWindow( 91, "Updating System ..." );
  532. //      Delay(2);
  533. //      StrCopy( szDefPath, WINDIR);
  534. //      StrConcat( szDefPath, "\\win.ini" );
  535. //      GetProfString( szDefPath,"ToolBook","startupSysBooks",szText);
  536. //      StrLength( szText);
  537. //      Assign( nLen, LAST_RESULT);
  538. //      if nLen = 0 then
  539. //    StrCopy ( szText, szSbkName);
  540. //    WriteProfString(szDefPath,"ToolBook","startupSysBooks",szText);
  541. //      else
  542. //    StrFind( szText, "tbkmm.sbk");
  543. //    if LAST_RESULT < 0 then
  544. //        if nLen != 0 then
  545. //            StrConcat ( szText, ",");
  546. //            StrConcat (szText, szSbkName);
  547. //        else
  548. //            StrConcat (szText, szSbkName);
  549. //        endif;
  550. //        WriteProfString(szDefPath,"ToolBook","startupSysBooks",szText);
  551. //    endif;
  552. //     endif;
  553.  
  554. //      StrCopy(szText,szRunPath);
  555.  //     StrConcat(szText,"\\tbkmm.sbk");
  556. //      MessageBox(szText, WARNING);
  557.  
  558. //      WriteProfString(szDefPath,"ToolBook","startupSysBooks",szText);
  559.       
  560.       //Just to be sure animations and wavefiles are recognized
  561. //      WriteProfString(szDefPath,"mci extensions","mmm","animation");
  562. //      WriteProfString(szDefPath,"mci extensions","wav","waveaudio");
  563.  
  564.       StrCopy( szDefPath, WINDIR);
  565.       StrConcat( szDefPath, "\\system.ini" );
  566.       WriteProfString(szDefPath,"mci","Animation","mcimmp.drv");
  567.  
  568. // Set macmmd.ini here
  569.       StrCopy( szDefPath, WINDIR);
  570.       StrConcat( szDefPath, "\\macmmd.ini" );
  571. // DPK - fix this...
  572. //      StrConcat( szDefPath, "\\max.ini" );
  573.  
  574.       GetDisk( SRCDIR, szDisk );
  575.       WriteProfString(szDefPath,"macmmd","macdir",szDisk);
  576.       if nUseHardDisk = 1 then
  577.     WriteProfString(szDefPath,"macmmd","userdir",szAppPath);
  578.         WriteProfString(szDefPath,"macmmd","reqdir",szAppPath);
  579.       else
  580.     WriteProfString(szDefPath,"macmmd","userdir",szDisk);
  581.         WriteProfString(szDefPath,"macmmd","reqdir",szDisk);
  582.       endif;
  583.  
  584. return;
  585.  
  586.  
  587. //-------------------------------------------------------------------------
  588. //
  589. //      Name:       ConfirmCancel
  590. //
  591. //      Descrip:    This will as the users if they want to terminate the
  592. //                  installation.
  593. //
  594. //      Params:
  595. //
  596. //-------------------------------------------------------------------------
  597. ConfirmCancel:
  598.  
  599.       AskYesNo( "Are you sure you want to CANCEL installation ?", FALSE );
  600.  
  601.       if LAST_RESULT = FALSE then return; endif;
  602.       exit;
  603.  
  604. return;
  605.  
  606. //-----------------------------------------------------------------------------
  607. //
  608. //      Name:       CopyError
  609. //
  610. //      Descrip:    This will be invoked when an error occurs during a
  611. //                  file transfer operation.
  612. //
  613. //      Params:     szErrFile
  614. //
  615. //-----------------------------------------------------------------------------
  616. CopyError:
  617.  
  618.   StrCopy( szErrMsg, "Unable to copy or decompress file: ");
  619.   StrConcat( szErrMsg, szErrFile);
  620.   MessageBox( szErrMsg, SEVERE );
  621.  
  622. return;
  623.  
  624. //-----------------------------------------------------------------------------
  625. //
  626. //      Name:       HandleExit
  627. //
  628. //      Descrip:    This will be invoked when the exit button is hit.
  629. //                  Normally you would use the default option IS provides
  630. //                  but this provides you the ability to perform
  631. //                  cleanup operations.  Here we are deleting the
  632. //                  synchronizing file.
  633. //
  634. //      Params:
  635. //
  636. //-----------------------------------------------------------------------------
  637. HandleExit:     // This will handle the exit button
  638.  
  639.     AskYesNo( "Are you sure you want to exit?", FALSE );
  640.     if LAST_RESULT = NO then
  641.        return;
  642.     endif;
  643.  
  644.     exit;
  645.  
  646.